#include <stdio.h>
#include <stdlib.h>

int m = 0, n = 0;
int bchange = 0;
int fn(int n)
{
    int k = 0;
    while(1)
    {
               if(n == 1)
        {
            break;
        }
        k++;

        //printf("n: %d\t", n);
        if(n % 2 == 1)
        {
            n = 3 * n +1;
        }
        else
        {
            n /= 2;
        }
    }

    //printf("k:%d\r\n", k);

    return k+1;
}

void swap(int* a, int* b)
{
    int temp = *a;
    *a = *b;
    *b = temp;
}

void process()
{
    int i = 0;
    int max = 0, temp = 0;
    while(scanf("%d %d", &m, &n) != EOF)
    {
        printf("%d %d ", m, n);
        if(m > n)
        {
            swap(&m, &n);
        }
        max = 0;
        for(i = m; i <= n; i++)
        {
            temp = fn(i);
            max = (max < temp) ? temp : max;
        }
        printf("%d\n", max);
    }
}

int main()
{
    //freopen("bin\\debug\\in.txt", "r", stdin);
    //freopen("bin\\debug\\out.txt", "w", stdout);

    process();

    return 0;
}
